﻿Namespace Controls.Converters
	Public Class AudioDriverToVisibilityConverter
		Implements IValueConverter

		Public Function Convert(value As Object, targetType As Type, parameter As Object, culture As Globalization.CultureInfo) As Object Implements IValueConverter.Convert
			With CType(value, ComboBoxItem)
				If .Content = "Wave Player" Then
					If CInt(parameter) = 0 OrElse CInt(parameter) = 3 Then
						Return Visibility.Visible
					Else
						Return Visibility.Collapsed
					End If
				ElseIf .Content = "WASAPI Player" Then
					If CInt(parameter) = 1 OrElse CInt(parameter) = 3 Then
						Return Visibility.Visible
					Else
						Return Visibility.Collapsed
					End If
				ElseIf .Content = "ASIO Player" Then
					If CInt(parameter) = 2 Then
						Return Visibility.Visible
					Else
						Return Visibility.Collapsed
					End If
				Else
					Return Visibility.Collapsed
				End If
			End With
		End Function

		Public Function ConvertBack(value As Object, targetType As Type, parameter As Object, culture As Globalization.CultureInfo) As Object Implements IValueConverter.ConvertBack
			Throw New NotImplementedException
		End Function
	End Class
End Namespace